#include "wave_atom.h"
#include "wave_plot.h"
#include <iostream>
#include <cstdlib>

using namespace std;

int main ( int argc, char *argv[] )
{
    if ( argc < 2 )
        exit ( EXIT_FAILURE );

    double f = atof ( argv[1] );
    AlignedSine sine ( f, 192000, false, 0.1 );
    cout << sine.GetFreq() << endl;
    cout << sine.GetSampleRate() / sine.GetFreq() * sine.GetLoop() << endl;

//    cout << endl;
//    bool suc = sine.Align(1);
//    cout << sine.GetFreq() << "\t" << sine.GetLoop() <<"\t" << boolalpha << suc << endl;
//    cout << sine.GetSampleRate() / sine.GetFreq() * sine.GetLoop() << endl;

    vector<double> table = sine.MakeWaveTable(sine.GetLoop());
    WavePlot(table, true);
//    for(int i = 0; i < table.size() ; ++i)
//    {
//        cout << table[i] <<endl;
//    }

    return 0;

}
